﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace CinemabookingWCFApp.DatesFolder
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "DatesService" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select DatesService.svc or DatesService.svc.cs at the Solution Explorer and start debugging.
    public class DatesService : IDatesService
    {
        #region
        CinemabookingDBDataContext db = new CinemabookingDBDataContext();
        #endregion

        public List<Date> GetAllDates()
        {
            var queryResult = (from x in db.Dates
                               select x);
            return queryResult.ToList();
        }

        public List<Date> GetDate(string DateId)
        {
            var queryResult = (from x in db.Dates
                               where x.date1 == DateId
                               select x);
            return queryResult.ToList();
        }

    }
}
